Skip to content

fix(desktop): isolate preview shortcuts from the host - #232

Merged
leoisadev1 merged 3 commits into
mainfrom
fix/desktop-preview-shortcut-isolation
Sep 14, 2026
Merged

fix(desktop): isolate preview shortcuts from the host#232
leoisadev1 merged 3 commits into
mainfrom
fix/desktop-preview-shortcut-isolation

Conversation

@leoisadev1

Copy link
Copy Markdown
Member

Problem

Keys typed in the in-app browser were forwarded into the host window. Cmd/Ctrl+K, comma, W, and Shift+J ran Akeru actions instead of staying in the page. Isolating those chords with setIgnoreMenuShortcuts then blocked native Cut/Copy/Paste/Undo in the guest.

Changes

Ignore host menu accelerators for preview guests. Stop synthesizing host key events. Re-enable native editing shortcuts only while that guest is focused, including macOS Paste and Match Style. Cmd/Ctrl+R still reloads the preview.

If a popup is created anyway, apply the same isolation. Akeru still denies window.open and loads the URL in the same guest.

Adapted from pingdotgg#9840 and pingdotgg#10621.

Scope

This PR is preview keyboard isolation only.

Covered here:

Still assigned to this handoff, in later PRs:

Verification

  • vp test run apps/desktop/src/preview/Manager.test.ts: 78 passed, including host-shortcut isolation and focused editing in tabs plus popups.
  • vp lint on the two files: no new errors. Pre-existing unused NativeImage import warning remains.

Native Cmd/Ctrl editing in a real Electron preview was not run on this Linux host.

Implemented and verified by Grok 4.6 High in Grok Build via Orca.

Stop forwarding preview chords into the main window, ignore host menu
accelerators, and re-enable native editing shortcuts only while the
preview guest is focused.
@vercel

vercel Bot commented Sep 10, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
akeru-bot-landing Skipped Skipped Sep 10, 2026 6:03pm UTC

Request Review

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:M labels Sep 10, 2026
@greptile-apps

greptile-apps Bot commented Sep 10, 2026

Copy link
Copy Markdown

Greptile Summary

This update isolates Electron preview keyboard input from host application shortcuts while preserving focused native editing commands and preview reload handling. It adds cross-platform coverage for shortcut classification, host isolation, focused editing behavior, and popup guests.

Confidence Score: 5/5

Safe to merge.

No outstanding findings.

Reviews (2): Last reviewed commit: "test(desktop): update preview teardown f..." | Re-trigger Greptile

@leoisadev1
leoisadev1 merged commit 845dc1a into main Sep 14, 2026
11 checks passed
@leoisadev1
leoisadev1 deleted the fix/desktop-preview-shortcut-isolation branch September 14, 2026 00:17
@github-actions github-actions Bot mentioned this pull request Sep 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant